{include file="public/header" /}
<link rel="stylesheet" href="/static/index/css/page/setting.css">
<body>
<div class="build-navbar" data-title="修改<?php echo $title[$type];?>"></div>
<div class="main">

    <form class="layui-form" action="{:url('user/edit')}" lay-filter="lay-form">
        <div class="vss m-30">
            {if $type == 'nickname'}
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">昵称</span>
                </div>
                <div class="right">
                    <input type="text" name="{$type}" placeholder="请填写要修改的昵称" autocomplete="off"
                           lay-verify="req"/>

                </div>
            </div>
            {elseif $type == 'mobile'}
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">当前手机号</span>
                </div>
                <div class="right">
                    <span class="text">{$user.mobile}</span>
                </div>
            </div>
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">新手机号</span>
                </div>
                <div class="right">
                    <input type="number" class="mobile" name="{$type}" placeholder="请填写新手机号" autocomplete="off"
                           lay-verify="req"/>
                </div>
            </div>
            <div class="item flex items-center justify-between p-30">
                <div class="left flex items-center justify-center">
                    <span class="text">验证码</span>
                </div>
                <div class="right flex items-center justify-center">
                    <input type="number" name="captcha" placeholder="请填写验证码" autocomplete="off" lay-verify="req"/>
                    <div class="captcha-btn ml-30 code">获取验证码</div>
                </div>
            </div>
            {/if}
        </div>
        <div class="btn theme-btn radius-20 fixed-btn b-30" lay-event="formSubmit">保存</div>
    </form>
</div>

</body>
{include file="public/footer"/}
<script>
    layui.use(['methods'], function () {
        //监听发送验证码倒计时
        layui.methods.listenSendMobileCaptcha({
            elem: '.code',
            url: '{:url("login/sendCode")}',
            mobile: '.mobile',
            cache: false,
            time: 60
        });
    });
</script>
</html>